<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/form_validate.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:15 GMT -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>H+ 后台主题UI框架 - 表单验证 jQuery Validation</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico"> <link href="/Public/Admin/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/Public/Admin/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="/Public/Admin/css/animate.min.css" rel="stylesheet">
    <link href="/Public/Admin/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="/Public/Admin/js/plugins/layer/skin/layer.css" rel="stylesheet">
    <link href="/Public/Admin/css/plugins/switchery/switchery.css" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>修改分组</h5>
                </div>
                <div class="ibox-content">
                    <form action="<?php echo U('group/save');?>" method="post" class="form-horizontal m-t" id="signupForm">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">分组名：</label>
                            <div class="col-sm-8">
                                <input  name="title" class="form-control" type="text" value="<?php echo ($groupInfo["title"]); ?>">
                                <input  name="id" class="form-control" type="hidden" value="<?php echo ($groupInfo["id"]); ?>">
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 不能包含特殊字符</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button class="btn btn-primary" type="submit">提交</button>
                                <button class="btn btn-defualt" type="reset" onclick="history.go(-1)">取消</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/Public/Admin/js/jquery.min.js?v=2.1.4"></script>
<script src="/Public/Admin/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/Public/Admin/js/content.min.js?v=1.0.0"></script>
<script src="/Public/Admin/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/Public/Admin/js/plugins/validate/messages_zh.min.js"></script>
<script src="/Public/Admin/js/jquery.form.js"></script>
<script src="/Public/Admin/js/plugins/layer/layer.min.js"></script>
<script src="/Public/Admin/js/plugins/validate/messages_zh.min.js"></script>
<script src="/Public/Admin/js/plugins/switchery/switchery.js"></script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
<script>
    //表单验证自定义检测方法
    $(document).ready(function(){
        $.validator.addMethod('checkName',function(value, element, param){
            if(/^[(\u4e00-\u9fa5)a-zA-Z0-9]{3,16}$/.test(value)) {
                return true;
            }else{
                return false;
            }
        },"");
        //表单验证
        $('#signupForm').validate({
            rules: {
                title: {
                    required: true,
                    minlength: 3,
                    checkName:true
                }
            },
            messages: {
                title: {
                    required: "请输入分组名",
                    minlength: "分组名必需由两个字符组成",
                    checkName:"不能包含特殊字符"
                }
            },
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    success:function(data){
                        if(data.status > 0){
                            layer.msg(data.msg, {icon: 6,time: 1000}, function(){
                                window.location.href="<?php echo U('Group/index');?>";
                            });
                        }else{
                            layer.msg(data.msg, {icon: 5,time: 1000},function(){
                                window.location.href="<?php echo U('Group/index');?>";
                            });
                        }
                    },
                    datatype:'json'
                })
            }
        });
        //开关按钮实例化
        var elem = document.querySelector('.js-switch');
        var switchery = new Switchery(elem, { });


    })
</script>
</body>


<!-- Mirrored from www.zi-han.net/theme/hplus/form_validate.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:16 GMT -->
</html>